home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1997
/
MacHack 1997.toast
/
Hacks
/
Hacks ’96
/
Better AD security
/
Source
/
ES Address Table.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-06-21
|
2KB
|
63 lines
/* NAME:
ES Address Table.c
WRITTEN BY:
Dair Grant
DESCRIPTION:
This file contains a a code resource that acts as a Gestalt Selector
function to be installed as an address table. When called, it will
return the address of its internal address table.
___________________________________________________________________________
*/
//=============================================================================
// Include files
//-----------------------------------------------------------------------------
#include "A4Stuff.h"
#include "SetupA4.h"
#include "ES Address Table.h"
//=============================================================================
// Function prototypes
//-----------------------------------------------------------------------------
pascal OSErr main(OSType theSelector, long *theResponse);
//=============================================================================
// Global variables
//-----------------------------------------------------------------------------
ESAddressTable gTheAddressTable;
//=============================================================================
// main : Entry point to our Gestalt Selector function.
//-----------------------------------------------------------------------------
// Note : When called, we return the address of our address table
// structure.
//-----------------------------------------------------------------------------
pascal OSErr main(OSType theSelector, long *theResponse)
{ long oldA4;
// Set up A4 to access our globals
#ifndef powerc
oldA4 = SetCurrentA4();
#endif
// Return the address of gTheAddressTable. We treat theResponse as a pointer
// to a variable that's a pointer to an address table, and write to it
// accordingly.
*theResponse = (long) &gTheAddressTable;
// Restore A4 and return
#ifndef powerc
SetA4(oldA4);
#endif
return(noErr);
}